﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masterpage/CommonPage.master" AutoEventWireup="true" CodeFile="RegistrationManagement.aspx.cs" Inherits="Activity_RegistrationManagement" %>
<%@ Register TagPrefix="CC" Namespace="Expo.Training.BRule.Controls" Assembly="Expo.Training.BRule" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="pagenav"><b>您现在的位置：</b>我的管理平台 > <a href="RegistrationManagement.aspx">活动报名信息管理</a></div>

<div class="searchpanel">
    <div class="searchpanelheader">
        <div class="searchpaneltitle"><img id="searchPanelImage" name="searchPanelImage" src="<%=ResolveThemeImagePath("searchpanelminus.jpg")%>" width="11" height="11" border="0" alt="" align="absmiddle" onclick="javascript:SwitchSearchPanel('searchPanelContent', this);" />&nbsp;搜索课程</div>
    </div>
    <div class="searchpanelcontent" id="searchPanelContent" name="searchPanelContent">
        <table cellspacing="4">
            
            <tr>
                <td>活动名称：</td>
                <td><asp:TextBox id="txtActivityTitle" MaxLength="20" runat="Server" CssClass="txtBox" Width="130" /></td>
                
                <td></td>
                <td colspan="2"></td>
            </tr>
            <tr>  
                <td>姓名：</td>
                <td ><asp:TextBox ID="txtRealName" MaxLength="40" runat="server" CssClass="txtBox" Width="130" /></td>
               
                <td></td>
                <td></td>            
            </tr> 
            
            <tr>
                <td>意向地点：</td>
                <td>
                    <asp:TextBox ID="txtIntention" MaxLength="40" runat="server" CssClass="txtBox" Width="130" />
                </td>
                <td></td>
                <td>
                <input type="submit" id="btnSearch" runat="server" value=" " class="SearchButton" onserverclick="btn_Search_Click" />
                <input type="hidden" id="txtQueryExpression" runat="server" />
                </td>
            </tr>         
        </table>
    </div>
    <div class="searchpanelfooter"></div>
</div>

<div style="overflow:auto;">
    <!--paneltitle-->
    <div class="paneltitle">活动报名列表</div>
    <!--paneladd-->
    <div class="paneladd">
        <input type="button" id="btSubmit"  runat="server"  onclick="return checkSubmitForm();" value=" 导 出 " class="btn" />
        <asp:Button ID="Button1" runat="server" Text="Button" onclick="btn_Export_Click" style = "display:none" />
        <img src="<%=ResolveThemeImagePath("icon_add.gif")%>" width="15" height="15" border="0" alt="" align="absmiddle" />&nbsp;<a href="AddRegistration.aspx">添加报名</a></div>
</div>

<div class="DG" id="dv_Result" runat="server" visible="true">
    <table cellspacing="0">
        <thead>
            <tr>
                <th style="width:7%;">序号</th>
                <th style="width:15%;">活动名称</th>
                <th style="width:8%;">姓名</th>
                <th style="width:7%;">年龄</th>
                <th style="width:14%;">手机</th>
                <th style="width:8%;">意向</th>
                <th style="width:7%;">人数</th>
                <th style="width:18%;">养游时间段</th>
                <th style="width:16%;">操作</th>
            </tr>
        </thead>
        <tbody>
            <asp:Repeater runat="server" ID="rpt_RegistrationList" OnItemCommand="rpt_Registration_ItemCommand">
                <ItemTemplate>
                    <tr>
                        <td><%# Container.ItemIndex + 1%></td>
                        <td><%# Eval("ActivityTitle") %></td>
                        <td><%# Eval("RealName").ToString()%></td>
                        <td><%# Eval("Age").ToString() %></td>
                        <td><%# Eval("Mobile")%></td>
                        <td><%# Eval("Intention")%></td>
                        <td><%# Eval("RegNumber").ToString() %></td>
                        <td><%# DisplayDate(Eval("BeginDate").ToString()) + "-" + DisplayDate(Eval("EndDate").ToString()) %></td>
                        <td>
                            <asp:Button ID="btn_Delete" runat="server" ToolTip="删除该报名" CausesValidation="true" CommandName="delete" OnClientClick="return confirm('确定要删除吗？')" CommandArgument='<%#Eval("RegistrationID") %>' CssClass="deleteButton" />
                            <a class="detailBtn_2"  rel="leanModal" name="dvModal" href="#dvModal" data_id='<%# Eval("RegistrationID")%>'></a>
                        </td>
                    </tr>
                </ItemTemplate>        
            </asp:Repeater>
        </tbody>
    </table>
    <div class="expager">
        <div class="right">
            <CC:ExPager ID="cc_ExPager" runat="server" PageSize="20" OnIndexChanged="PageIndex_Changed" />
        </div>
    </div>
    <div id="dvModal" style="display: none; position: fixed; opacity: 1; z-index: 11000; left: 50%; margin-left: -330px; top: 200px;">
        <div id="dvModal-header">
            <h2>报名详细</h2>
            <a class="modal_close" href="#"></a>
        </div>
        <div id="dvModal-content" style="margin: 10px;"></div>
    </div>
</div>
<script type="text/javascript">
    jQuery(document).ready(function() {

        jQuery(".detailBtn_2").click(function() {
            var _id = jQuery(this).attr("data_id");

            jQuery.ajax({
                type: "POST", //访问WebService使用Post方式请求
                contentType: "application/json;charset=utf-8", //WebService 会返回Json类型
                url: "ActivityService.asmx/GetRegistrationDetails", //调用WebService
                data: "{id:'" + _id + "'}", //参数
                dataType: 'json',
                beforeSend: function(x) { x.setRequestHeader("Content-Type", "application/json; charset=utf-8"); jQuery("#dvModal-content").empty(); },
                error: function(x, e) { },
                success: function(response) {

                    var json = eval("(" + response.d + ")");

                    var _sex;

                    if (json.Sex == "1") {
                        _sex = "男";
                    } else if (json.Sex == "2") {
                        _sex = "女";
                    } else {
                        _sex = "";
                    }

                    var _beginDate = new Date(json.BeginDate);
                    var _beginDateStr = _beginDate.getFullYear() + '/' + (_beginDate.getMonth() + 1) + '/' + _beginDate.getDate();
                    var _endDate = new Date(json.EndDate);
                    var _endDateStr = _endDate.getFullYear() + '/' + (_endDate.getMonth() + 1) + '/' + _endDate.getDate();

                    jQuery("#dvModal-content").append("<p>姓名：" + json.RealName + "</p>");
                    jQuery("#dvModal-content").append("<p>性别：" + _sex + "</p>");
                    jQuery("#dvModal-content").append("<p>年龄：" + json.Age + "</p>");
                    jQuery("#dvModal-content").append("<p>家庭地址：" + json.FamilyAddress + "</p>");
                    jQuery("#dvModal-content").append("<p>联系地址：" + json.ContactAddress + "</p>");
                    jQuery("#dvModal-content").append("<p>手机：" + json.Mobile + "</p>");
                    jQuery("#dvModal-content").append("<p>养游时间段：" + _beginDateStr + " 至 " + _endDateStr + "</p>");
                    jQuery("#dvModal-content").append("<p>意向地点：" + json.Intention + "</p>");
                    jQuery("#dvModal-content").append("<p>服务需求：" + json.Requirement + "</p>");
                    jQuery("#dvModal-content").append("<p>随行人数：" + json.RegNumber + "</p>");
                }
            });
        });

        jQuery("a[rel*=leanModal]").leanModal({ top: 100, closeButton: ".modal_close" });
    });

    function checkSubmitForm() {
        __doPostBack('ctl00$ContentPlaceHolder1$Button1', '');
    }
    
</script>

</asp:Content>

